c# string contains any of list

34

c# string contains any of list -

//linq
bool b = listOfStrings.Any(s=>myString.Contains(s));
//shorter but less clear
bool b = listOfStrings.Any(myString.Contains);

Comments

Submit
0 Comments